package edu.pe.cayetano.model.bo;

import java.util.ArrayList;

import org.apache.commons.beanutils.DynaBean;

import ws.synopsis.frmwrk.common.BResult;
import edu.pe.cayetano.dao.AlumnoDAO;
import edu.pe.cayetano.framework.BusinessException;
import edu.pe.cayetano.model.bean.AlumnoBean;

public class AlumnoBO extends BaseBO{

	public BResult getAlumnosxCiclo(DynaBean dyna) throws BusinessException{
		
		BResult 				ret					= new BResult();
		ArrayList<AlumnoBean> 	listadoOperadores	 	= new ArrayList<AlumnoBean>();
		
		try{
			conectar();
			AlumnoDAO alumnoDAO = new AlumnoDAO(conn);
			listadoOperadores = alumnoDAO.getAlumnosxCiclo((String)dyna.get("cboCiclo"));
			ret.setObject(listadoOperadores);
		}catch(Exception e){
			ret.setException(e);
		}finally{
			try{
				desconectar();
			}catch(Exception e){
			}
		}
		return ret;
	}
	
	public BResult getAlumnosxCiclo(int cboCiclo) throws BusinessException{
		
		BResult 		ret					= new BResult();
		ArrayList<AlumnoBean> 	listadoOperadores	 	= new ArrayList<AlumnoBean>();
		
		try{
			conectar();
			AlumnoDAO alumnoDAO = new AlumnoDAO(conn);
			listadoOperadores = alumnoDAO.getAlumnosxCiclo(String.valueOf(cboCiclo));
			ret.setObject(listadoOperadores);
		}catch(Exception e){
			ret.setException(e);
		}finally{
			try{
				desconectar();
			}catch(Exception e){
			}
		}
		return ret;
	}
}
